/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package multicastserver;

import java.io.*;
import java.net.*;
import java.util.*;
public class MulticastServer {
  static public void main(String args[]) {
     DatagramSocket socket = null;
     BufferedReader in = null;
     boolean moreQuotes = true;
     try {
        socket = new DatagramSocket();
        while (true) {
             InetAddress grupo = InetAddress.getByName("224.0.0.100");
             for (int i=1; i< 1000; i++) {
                   String dString = i+"--"+(InetAddress.getLocalHost());
                   byte[] buf = dString.getBytes();
	DatagramPacket packet = 
                   new DatagramPacket(buf, buf.length, grupo, 2345);
                   socket.send(packet);
                   try {
	Thread.currentThread().sleep(1000); }
	catch (InterruptedException e) {}
                   }
          }
       } catch (IOException e) {}
   }
}
